<template>
  <div class="pagination">
<el-pagination
  background
  :page-size="4"
  layout="prev, pager, next"
  @current-change="pageChangeHandler"
  :total="total">
</el-pagination>
  </div>
</template>

<script>
  export default {
    // 向父亲接收参数
    props:['total'],
    methods:{
      pageChangeHandler(page){
        this.$emit('pageChange',page)
      }
    }
  }
</script>

<style lang="less" scoped>
.pagination{
  margin-top: 20px;
}
</style>